// cookie保存的天数
import Cookies from 'js-cookie'

// export const TOKEN_KEY = 'access_token'

export const setCookieItem = (key: string, value: string, cookieExpires?: any): void => {
  if (cookieExpires !== null) {
    Cookies.set(key, value, cookieExpires)
  } else {
    Cookies.set(key, value)
  }
}

export const getCookieItem = (key: string): string | null => {
  const value: string | null = Cookies.get(key)
  if (value != null) return value
  else return null
}

export const delCookieItem = (key: string): void => {
  Cookies.remove(key)
}
